package name.huzhenbo.java.patterns.responsibilitychain;

class NaiveDialog implements HelpHandler {
    private HelpHandler successor;

    public NaiveDialog(HelpHandler successor) {
        this.successor = successor;
    }

    public boolean hasHelp(Topic topic) {
        return Topic.DIALOG_TOPIC == topic;
    }

    public String handleHelp(Topic topic) {
        if (hasHelp(topic)) {
            return "dialog help";
        } else {
            return successor.handleHelp(topic);
        }
    }
}
